#include <iostream>
#include <vector>

using namespace std;
int main()
{
    int n;
	int *a, *b;

	cin >> n;
	a = new int [n];
	for(int i=0; i<n; i++) cin >> a[i];
	b = new int [n];
	for(int i=0; i<n; i++) cin >> b[i];

	bool bEqual = true;
	for(int i=0; i<n; i++)
    {
        if(a[i]!=b[i])
            bEqual = false;
	}

	for(int i=0; i<n; i++) cout<< a[i] <<"  ";
	cout << endl;
	for(int i=0; i<n; i++) cout<< b[i] <<"  ";
	cout << endl;

    if (bEqual)
        cout << "Equal" << endl;
    else
        cout << "Not equal" << endl;

	vector<int> va(a, a+n), vb(b, b+n);

	if (va==vb)
        cout << "Equal" << endl;
    else
        cout << "Not equal" << endl;

    delete []a;
    delete []b;
    return 0;
}


